package edu.ynu.se.xiecheng.achitectureclass.controller;

import edu.ynu.se.xiecheng.achitectureclass.common.controller.LogicController;
import edu.ynu.se.xiecheng.achitectureclass.dao.SoilMoistureContentDao;
import edu.ynu.se.xiecheng.achitectureclass.dto.DataDTO;
import edu.ynu.se.xiecheng.achitectureclass.entity.SoilMoistureContent;
import edu.ynu.se.xiecheng.achitectureclass.service.SoilMoistureContentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "土壤含水率实体的控制器")
@RestController
@RequestMapping("/soilMoistureContent")
public class SoilMoistureContentController extends LogicController<SoilMoistureContentService, SoilMoistureContentDao, SoilMoistureContent,Long> {
    public SoilMoistureContentController(SoilMoistureContentService soilMoistureContentService) {
        super(soilMoistureContentService);}

        @ApiOperation("获取最近7个土壤含水率的数据")
        @GetMapping("/get7Data")
        public List<DataDTO> get7Data () {
            return service.get7Data();
        }
}
